<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en">
  <title id="fn141670">gp_pgdatabase</title>
  <body>
    <p>The <codeph>gp_pgdatabase</codeph> view shows status information about the Greenplum segment instances and whether they are acting as the mirror or
      the primary. This view is used internally by the Greenplum fault
      detection and recovery utilities to determine failed segments.</p>
    <table id="fn141982">
      <title>pg_catalog.gp_pgdatabase</title>
      <tgroup cols="4">
        <colspec colnum="1" colname="col1" colwidth="99.75pt"/>
        <colspec colnum="2" colname="col2" colwidth="66pt"/>
        <colspec colnum="3" colname="col3" colwidth="165pt"/>
        <colspec colnum="4" colname="col4" colwidth="147pt"/>
        <thead>
          <row>
            <entry colname="col1">column</entry>
            <entry colname="col2">type</entry>
            <entry colname="col3">references</entry>
            <entry colname="col4">description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry colname="col1">
              <codeph>dbid</codeph>
            </entry>
            <entry colname="col2">smallint</entry>
            <entry colname="col3">gp_segment_configuration.dbid</entry>
            <entry colname="col4">System-assigned ID. The unique identifier of a segment (or master)
              instance.</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>isprimary</codeph>
            </entry>
            <entry colname="col2">boolean</entry>
            <entry colname="col3">gp_segment_configuration.role</entry>
            <entry colname="col4">Whether or not this instance is active. Is it currently acting as
              the primary segment (as opposed to the mirror).</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>content</codeph>
            </entry>
            <entry colname="col2">smallint</entry>
            <entry colname="col3">gp_segment_configuration.content</entry>
            <entry colname="col4">The ID for the portion of data on an instance. A primary segment
              instance and its mirror will have the same content ID.<p>For a segment the value is
                from 0-<i>N-1</i>, where <i>N</i> is the number of segments in Greenplum Database.</p><p>For the master, the value is -1.</p></entry>
          </row>
          <row>
            <entry><codeph>valid</codeph></entry>
            <entry>boolean</entry>
            <entry>gp_segment_configuration.mode</entry>
            <entry>Whether or not this instance is up and the mode is either <i>s</i>(synchronized)
              or <i>n</i> (not in sync). </entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>definedprimary</codeph>
            </entry>
            <entry colname="col2">boolean</entry>
            <entry colname="col3">gp_segment_ configuration.preferred_role</entry>
            <entry colname="col4">Whether or not this instance was defined as the primary (as
              opposed to the mirror) at the time the system was initialized.</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </body>
</topic>
